package com.ruoyi.system.mapper;

import java.util.List;

import com.ruoyi.system.domain.Purchase;
import com.ruoyi.system.domain.PurchaseRecord;
import com.ruoyi.system.domain.Warehousing;

/**
 * 入库单Mapper接口
 * 
 * @author ruoyi
 * @date 2021-05-08
 */
public interface WarehousingMapper 
{
    /**
     * 查询入库单
     * 
     * @param id 入库单ID
     * @return 入库单
     */
    public Warehousing selectWarehousingById(Long id);

    /**
     * 查询入库单列表
     * 
     * @param warehousing 入库单
     * @return 入库单集合
     */
    public List<Warehousing> selectWarehousingList(Warehousing warehousing);

    /**
     * 新增入库单
     * 
     * @param warehousing 入库单
     * @return 结果
     */
    public int insertWarehousing(Warehousing warehousing);

    /**
     * 修改入库单
     * 
     * @param warehousing 入库单
     * @return 结果
     */
    public int updateWarehousing(Warehousing warehousing);

    /**
     * 删除入库单
     * 
     * @param id 入库单ID
     * @return 结果
     */
    public int deleteWarehousingById(Long id);

    /**
     * 批量删除入库单
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteWarehousingByIds(Long[] ids);

    //查询链表
    List<Warehousing> selectWarehouList(Warehousing warehousing);

    //查询name不为空的
    List<Warehousing> selectWarehousing(Warehousing warehousing);

    //查询出库单详情
    Warehousing selectOutingById(Long id);

    //根据id查询purid
    Long selectWarehousingBypurId(Long id);

    //根据mdId查询总量
    double selectSum(Long inMdId);


    //查询是不是采购单生成的材料
    Integer CountPurId(Long recId);

    //根据recId删除单材料
    void deleteMatByRecId(Long recId);

    //修改WarehousingId
    void updateWareId(PurchaseRecord purchaseRecord);


     //修改outingId
    void updateOutId(PurchaseRecord purchaseRecord);




    //查看入库材料的状态
    int selectInState(Long id);

    //批量删除入库单材料
    void deleteAllMat(Long id);

    //批量修改入库单材料
    void updateAllWareId(Long id);

    //更新采购单信息
    void updatePurchaseInState(Long purId);


    //查看出库材料的状态
    int selectOutState(Long id);
    //批量删除出库单材料
    void deleteAllOutMat(Long id);
    //批量修改出库单材料
    void updateAllOutId(Long id);

    //更新采购单出库状态
    void updatePurchaseOutState(Long purId);

    int selectStateIn(Long id);

    int selectStateOut(Long id);
}
